#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>
#include<string.h>
#include<sys/stat.h>
#include<fcntl.h>
int main()
{
  int fd=open("/dev/pts/1",O_WRONLY|O_APPEND);
  if(fd<0)
  {
    return 1;
  }
  const char* mess="hello\n";
  while(1)
  {
      write(fd,mess,strlen(mess));
      sleep(1);
  }
  //while(1)
  //{
  //  printf("i am a process,pid:%d\n",getpid());
  //  sleep(1);
  //}
  close(fd);
  return 0;
}
